﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Net;

namespace Tornado
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (args.Length == 3)
            {
                try
                {
                    string[] sAddr = args[0].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries);
                    byte[] bAddr = new byte[4];
                    for (int i = 0; i < 4; i++)
                        bAddr[i] = byte.Parse(sAddr[i]);
                    IPAddress a = new IPAddress(bAddr);

                    int port = int.Parse(args[1]);
                    bool open = bool.Parse(args[2]);

                    Application.Run(new frmReceiveFile(a, port, open));
                }
                catch { }
            }
            else
            if (args.Length == 2)
            {
                Application.Run(new frmLazer());
            }
            else
            {
               Application.Run(new frmMain());
            }
        }
    }
}
